import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import 'reset-css'
import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';
import axios from './http'
import dayjs from 'dayjs'

Vue.config.productionTip = false
Vue.use(ElementUI);
Vue.filter('dealTime', (val)=>{
  return dayjs(val).format('YYYY-MM-DD HH:mm:ss')
})
axios.defaults.baseURL = 'http://localhost:3000/admin/api/'
Vue.prototype.$http = axios

Vue.mixin({ //混入
  computed: {
    headers() { //上传消息头
      return {
        Token: store.state.token || ''
      }
    }
  },
  methods: {
    actionUrl() { //上传路径
      return axios.defaults.baseURL+'upload'
    }
  },
})

new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')
